From 8a468fad09440e91bfb107d7b8feb14addcb3980 Mon Sep 17 00:00:00 2001 From: Carlos Liam Date: Mon, 19 Oct 2015 11:17:53 -0400 Subject: [PATCH] Clean whitespace Remove leading newlines; replace lines containing only whitespace with empty lines; replace multiple trailing newlines with a single newline; remove trailing whitespace in lines --- src/cargo/ops/cargo_rustc/job_queue.rs | 2 +- src/etc/_cargo | 6 +++--- tests/test_cargo_cross_compile.rs | 4 ++-- tests/test_cargo_run.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cargo/ops/cargo_rustc/job_queue.rs b/src/cargo/ops/cargo_rustc/job_queue.rs index 5966ca3ed..6dea0a60d 100644 --- a/src/cargo/ops/cargo_rustc/job_queue.rs +++ b/src/cargo/ops/cargo_rustc/job_queue.rs @@ -203,7 +203,7 @@ impl<'a> JobQueue<'a> { // out any more information for a package after we've printed it once. fn note_working_on(&mut self, config: &Config, key: &Key<'a>, fresh: Freshness) -> CargoResult<()> { - if (self.compiled.contains(key.pkg) && !key.profile.doc) || + if (self.compiled.contains(key.pkg) && !key.profile.doc) || (self.documented.contains(key.pkg) && key.profile.doc) { return Ok(()) } diff --git a/src/etc/_cargo b/src/etc/_cargo index f7015de8b..2f8a2c824 100644 --- a/src/etc/_cargo +++ b/src/etc/_cargo @@ -306,7 +306,7 @@ regexp-replace manifest '\{"root":"|"\}' '' echo $manifest } -# Extracts the values of "name" from the array given in $1 and shows them as +# Extracts the values of "name" from the array given in $1 and shows them as # command line options for completion _get_names_from_array() { @@ -325,7 +325,7 @@ _get_names_from_array() do if [[ $last_line == "[[$block_name]]" ]]; then in_block=true - else + else if [[ $last_line =~ '.*\[\[.*' ]]; then in_block=false fi @@ -336,7 +336,7 @@ _get_names_from_array() regexp-replace line '^.*name *= *|"' "" names+=$line fi - fi + fi last_line=$line done < $manifest diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs index ca75fac35..623de021b 100644 --- a/tests/test_cargo_cross_compile.rs +++ b/tests/test_cargo_cross_compile.rs @@ -568,10 +568,10 @@ test!(build_script_needed_for_host_and_target { .with_stdout_contains(&format!("\ {compiling} d1 v0.0.0 ({url})", compiling = COMPILING, url = p.url())) .with_stdout_contains(&format!("\ -{running} `rustc d1[..]build.rs [..] --out-dir {dir}[..]target[..]build[..]d1-[..]`", +{running} `rustc d1[..]build.rs [..] --out-dir {dir}[..]target[..]build[..]d1-[..]`", running = RUNNING, dir = p.root().display())) .with_stdout_contains(&format!("\ -{running} `{dir}[..]target[..]build[..]d1-[..]build-script-build`", running = RUNNING, +{running} `{dir}[..]target[..]build[..]d1-[..]build-script-build`", running = RUNNING, dir = p.root().display())) .with_stdout_contains(&format!("\ {running} `rustc d1[..]src[..]lib.rs [..]`", running = RUNNING)) diff --git a/tests/test_cargo_run.rs b/tests/test_cargo_run.rs index 11a9d9311..1cb3550aa 100644 --- a/tests/test_cargo_run.rs +++ b/tests/test_cargo_run.rs @@ -501,7 +501,7 @@ test!(run_from_executable_folder { let cwd = p.root().join("target").join("debug"); p.cargo_process("build").exec_with_output().unwrap(); - assert_that(p.cargo("run").cwd(cwd), + assert_that(p.cargo("run").cwd(cwd), execs().with_status(0).with_stdout(&format!("\ {running} `.{sep}foo[..]` hello -- 2.30.2